import 'package:flutter/material.dart';

import '../../../../../helper/utils/util.dart';
import 'controller.dart';

class FindBackSuccessPage extends StatelessWidget {
  FindBackSuccessPage({Key? key}) : super(key: key);
  final controller = Get.put(FindBackSuccessController());
  final state = Get.find<FindBackSuccessController>().state;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: presentAppBar(context),
        backgroundColor: Colors.white,
        body: Padding(
          padding: EdgeInsets.symmetric(horizontal: 31.w),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              SizedBox(
                height: 51.r,
              ),
              LottieBuilder.asset(
                'assets/jsons/success.json',
                width: 130.r,
                height: 130.r,
                repeat: false,
              ),
              SizedBox(
                height: 27.r,
              ),
              Text(
                '密码找回成功',
                style: TextStyle(
                  color: const Color(0xff333333),
                  fontSize: 17.sp,
                  fontWeight: FontWeight.bold,
                ),
              ),
              SizedBox(
                height: 10.r,
              ),
              Text(
                '密码已成功找回，快去登录试试吧~',
                style:
                    TextStyle(color: const Color(0xff999999), fontSize: 14.sp),
              ),
              SizedBox(
                height: 73.r,
              ),
              InkWell(
                onTap: () {
                  Get.offAllNamed(RouterPath.login);
                },
                child: Container(
                  height: 50.r,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: ColorsUtil.blue,
                    borderRadius: BorderRadius.circular(5.r),
                  ),
                  child: GetBuilder<FindBackSuccessController>(
                    builder: (_) {
                      return Text(
                        '（${state.downCount}s）返回登录',
                        style: TextStyle(
                          color: Colors.white,
                          fontSize: 17.sp,
                        ),
                      );
                    },
                  ),
                ),
              )
            ],
          ),
        ));
  }
}
